<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //快慢双指针不相等的交换值
    // function fn(nums) {
    //     let slow = 0;
    //     let fast = 1;
    //     let n = nums.length
    //     while (fast < n) {
    //         if (nums[slow] !== nums[fast]) {
    //             nums[++slow] = nums[fast]
    //         }
    //         fast++
    //     }
    //     return slow+1
    //     // console.log(nums, "----nnn");

    // }
    // console.log(fn([0, 1, 2, 2, 3, 3, 4]),"----");
    
</script>

</html>